class Solution {
public:
    vector<string> validStrings(int n)
    {
        const int N = n;
        vector<string> ans;
        vector<string> tmp;
        for (int i = 0; i < (int)pow(2, n); i++)//8
        {
            string s(n, '0');
            int t = i;
            for (int j = n - 1; j >= 0; j--)
            {
                s[j] = t % 2 + '0';
                t /= 2;
            }
            tmp.push_back(s);
        }
        for (auto& a : tmp)
        {
            bool flag = true;
            for (int i = 0, j = i + 1; j < n; i++, j++)
            {
                if (a[i] == '0' && a[j] == '0')
                {
                    flag = false;
                    break;
                }
            }
            if (flag) ans.push_back(a);
        }
        return ans;
    }
};